// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package edu.uwlax.cs.oayonlinestore.entities;

/**
 * @see edu.uwlax.cs.oayonlinestore.entities.Category
 */
public class CategoryImpl extends edu.uwlax.cs.oayonlinestore.entities.Category {
	private static final long serialVersionUID = 7134061234261328569L;

	/**
	 * @see edu.uwlax.cs.oayonlinestore.entities.Category#addManager(edu.uwlax.cs.oayonlinestore.entities.User)
	 */
	public void addManager(edu.uwlax.cs.oayonlinestore.entities.User manager) {

		if (manager.isCanBeCategoryPerson() && manager.isIsActive()
				&& !this.getManagers().contains(manager))
			{this.getManagers().add(manager);
			
			}
		else
			throw new java.lang.UnsupportedOperationException(
					"Manager was not added successfully, try agian please.");

	}

	/**
	 * @see edu.uwlax.cs.oayonlinestore.entities.Category#removeManager(edu.uwlax.cs.oayonlinestore.entities.User)
	 */
	public void removeManager(edu.uwlax.cs.oayonlinestore.entities.User manager) {

		if (this.getManagers().contains(manager))
			this.getManagers().remove(manager);
		else
			throw new java.lang.UnsupportedOperationException(
					"This manager does not exist in this Category.");

	}

	/**
	 * @see edu.uwlax.cs.oayonlinestore.entities.Category#addStaff(edu.uwlax.cs.oayonlinestore.entities.User)
	 */
	public void addStaff(edu.uwlax.cs.oayonlinestore.entities.User staff) {

		if (staff.isCanBeCategoryPerson() && staff.isIsActive()
				&& !this.getStaffMembers().contains(staff))
			this.getStaffMembers().add(staff);
		else
			throw new java.lang.UnsupportedOperationException(
					"Staff member was not added successfully, try agian please.");

	}

	/**
	 * @see edu.uwlax.cs.oayonlinestore.entities.Category#removeStaff(edu.uwlax.cs.oayonlinestore.entities.User)
	 */
	public void removeStaff(edu.uwlax.cs.oayonlinestore.entities.User staff) {

		if (this.getStaffMembers().contains(staff))
			this.getStaffMembers().remove(staff);
		else
			throw new java.lang.UnsupportedOperationException(
					"This staff member does not exist in this Category.");
	}

}